pull: Redo logic for "scanning"
authorColin Walters <walters@verbum.org>
Tue, 1 Nov 2016 17:51:55 +0000 (13:51 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 16 Nov 2016 22:17:25 +0000 (22:17 +0000)
commit814aa9682514f2bc342f05032021774d3f128f17
tree41979ea0582a402cac2fd75b494d220fe46df0d6
parent37c07d2f1c90b12bcfba85a7d900f81a7c362eb4
pull: Redo logic for "scanning"

What in the code is called "scanning" is ensuring (potentially
recursively) have an object, and if not, fetching it.  And then if
it's metadata, parsing it and finding new objects to fetch.

This logic has grown fairly complex.  What I'm trying to fix
right now is that if we're doing a pull-local to a remote repository
via `sshfs` (FUSE) we still end up scanning, which is inefficient.

We can take advantage of the "commitpartial" logic here - if a commit
isn't partial, it's complete, hence we don't need to scan it.

At the same time, I'm changing the logic here to *always* do scans for
dirtree objects.  This will fix cases where multiple commits share
dirtree objects.  We have "commitpartial" metadata, but no such concept
of partial/complete for dirtrees.

But, we'll only ever scan dirtrees if we scan commits, which is
what the section above fixes.

Closes: https://github.com/ostreedev/ostree/issues/543
Closes: #564
Approved by: alexlarsson
src/libostree/ostree-repo-pull.c